package com.ficus.road.maintain.core.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author xiawen yang
 * @date 2022/7/25 上午10:38
 */
@Getter
public enum HitTypeEnum {
    PIC_CRACK_RESULT_PIC_CRACK("PIC_CRACK_RESULT_PIC_CRACK"),                       //路面裂缝
    PIC_CRACK_RESULT_BROKEN_BOARD("PIC_CRACK_RESULT_BROKEN_BOARD"),                 //板块碎裂
    PIC_CRACK_RESULT_CRACKED("PIC_CRACK_RESULT_CRACKED"),                           //路面龟裂
    PIC_POTHOLES_RESULT_DEPRESSION("PIC_POTHOLES_RESULT_DEPRESSION"),               //路面坑塘
    PIC_POTHOLES_RESULT_SETTLEMENT("PIC_POTHOLES_RESULT_SETTLEMENT");               //路面沉陷
    private final String value;

    HitTypeEnum(String value) {
        this.value = value;
    }

    @JsonCreator
    public static HitTypeEnum fromValue(String value) {
        for (HitTypeEnum b : HitTypeEnum.values()) {
            if (b.value.equals(value)) {
                return b;
            }
        }
        throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    @Override
    @JsonValue
    public String toString() {
        return String.valueOf(value);
    }
}
